#include <iostream>
#include <cmath>
using namespace std;

bool isPrime(int num) {
    if (num < 2) return false;
    int sqr = sqrt(num);
    for (int i = 2; i <= sqr; i++) {
        if (num % i == 0) return false;
    }
    return true;
}

int main() {
    int n;
    while (cin >> n) {
        int count = 0;
        while (n--) {
            int num;
            cin >> num;
            if (isPrime(num)) count++;
        }
        cout << count << endl;
    }
    return 0;
}
